package com.huan.spring6.iocxml.life;

import org.springframework.beans.factory.DisposableBean;

public class User{
    private String name;

    public User() {
        System.out.println("1 调用无参数构造创建bean对象");
    }
    public void setName(String name) {
        System.out.println("2 bean对象 设置属性值");
        this.name = name;
    }
    //初始化方法
    public void initMethod(){
        System.out.println("4 调用指定方法，bean对象初始化");
    }
    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
    //销毁方法
    public void destroy() {
        System.out.println("7 bean对象销毁，调用指定销毁方法");
    }
}
